package com.irany.enums;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.ToString;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * @author shujian.ou
 * @since 2021/5/19 0019 19:29
 */
@Getter
@ToString
@AllArgsConstructor
public enum TaskTypeEnum {

    /**
     * 故事
     */
    STORY(Collections.singletonList("故事")),

    /**
     * 子任务
     */
    TASK(Collections.singletonList("子任务")),
    /**
     * BUG
     */
    BUG(Arrays.asList("缺陷", "测试Bug"));

    private final List<String> typeName;

    public static TaskTypeEnum getByName(String typeName) {
        for (TaskTypeEnum value : TaskTypeEnum.values()) {
            if (value.typeName.contains(typeName)) {
                return value;
            }
        }
        return null;
    }
}
